'''
    账单流水装饰器
    @:param
        user_index: 用户id
        op_type   ：操作类型
        money     ：操作金额

'''
from util.DbUtils import DatabaseUtil
def balance_flow_wrapper(func):
    def wrapper(user_index,op_type,money):
        func(user_index,op_type,money)
        db = DatabaseUtil(user="root", password="123456", database="woniuatm", port=3306)
        remark = op_type + ": " + str(money)
        from services.AccountService import save_history
        save_history(user_index,op_type,money)
    return wrapper